<template>
  <a-card :bordered="false">

     <!-- 详情列表 -->

     <template>
  <a-descriptions title="库存详情">
  
  <a-descriptions-item label="供应商商品编号" v-if="type==0">
   {{supplierGoodsCode}}
  </a-descriptions-item>
  
  <a-descriptions-item label="供应商面料编号" v-if="type==1">
   {{gysfabriccode}}
  </a-descriptions-item>
  
	<a-descriptions-item label="面料纱织" v-if="type==1">
	 {{fabricShazhi}}
	</a-descriptions-item>
	
	<a-descriptions-item label="面料品牌" v-if="type==1">
	 {{pingpai}}
	</a-descriptions-item>
	
	<a-descriptions-item label="门幅" v-if="type==1">
	 {{menfu}}
	</a-descriptions-item>
	
    <a-descriptions-item label="商品编号" v-if="type==0">
      {{goodsCode}}
    </a-descriptions-item>
	
	<a-descriptions-item label="面料编号" v-if="type==1">
	  {{fabricCode}}
	</a-descriptions-item>
    <a-descriptions-item label="单位">
      {{unit}}
    </a-descriptions-item>
	<a-descriptions-item label="总库存">
	 {{sumCount}}
	</a-descriptions-item>

	
  </a-descriptions>



</template>

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <template>
      <div class="container">
    <!--    <div class="top">
          <div class="wid" style="float: left;"> -->
           
            <!--            <a href="#"><i class="el-icon-arrow-left"></i>返回</a>-->
         <!-- </div>
        </div> -->
    <!--    <div class="order">
          <div class="wid" style="float: left">
            <span @click="bubu(1)">业务流水</span>



          </div>
      
        </div> -->
      </div>
    </template>
    <template>
      <div class="ant-alert ant-alert-info"
           style="margin-bottom: 5px;height:50px;background-color: #ffffff;margin-top: 120px;border: none;">
      
 
      </div>
    </template>

    <div>
      <div class="ant-alert ant-alert-info"
           style="margin-bottom: 10px;height: 40px;border: none;background-color: #ffffff;">
        <h4 class="anticon anticon-info-circle ant-alert-icon" style="color: #000c17;margin-top: 10px;border: none;">
          {{neirong}}</h4>
      </div>

      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
               :pagination="ipagination"
               :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
               class="j-table-force-nowrap"
               @change="handleTableChange" style="margin-left: 10px;margin-right: 20px;" v-show="this.tabs==1">
			   
	
		
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt=""
               style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="uploadFile(text)">
            下载
          </a-button>
        </template>

        <span slot="action" slot-scope="text, record">
                   <a v-if="record.isAfter==0" @click="see_orderDetail(record.orderSn,record.type)">查看订单详情</a>
        </span>
      </a-table>


    </div>

  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import '@/assets/less/style.min.css'
  import {
    mixinDevice
  } from '@/utils/mixin'
  import {
    JeecgListMixin
  } from '@/mixins/JeecgListMixin'
  import {
    query_companydetailinfo
  } from '@/api/api'
  import {
    query_companyjiedaninfo
  } from '@/api/api'
  import {
    query_company_commissionlist
  } from '@/api/api'
  import {
    deleteAction,
    getAction,
    putAction,
    postAction,
    downFile,
    getFileAccessHttpUrl
  } from '@/api/manage'

  export default {
    name: 'InveotoryDetail',
    mixins: [JeecgListMixin, mixinDevice],
    components: {

    },
    data () {
      return {
		  menfu:'',
		  pingpai:'',
		  fabricShazhi:'',
		  sumCount:'',
		  unit:'',
		  goodsCode:'',
		  fabricCode:'',
		  type:0,
		  businessLicense:'',
				remark:'',
		  address:'',
		  accountBalance:'',
		  remainingLimit:'',
        userId:"",
          customertype:'',
        companyName:'',
        companyCode:'',
        aboutPerson:'',
        aboutPhone:'',
        monthLines:'',
        description: 'lgyx_pickorder_info管理页面',
        companyDetailbyid: [],
        sexl: '',
        usersource: '',
        certification: '',
        tabs: 1,
        neirong: '业务流水',
        dictOptions: {},
        dataSource: [],
        shinumber: 0,
        columns: [
           {
            title: '序号',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: "center",
            customRender: function (t, r, index) {
              return parseInt(index) + 1;
            }
          },
					{
					  title: '批次名称',
					  align: 'center',
					  dataIndex: 'batchName'
					},
          {
          title: '批次/匹号',
          align: 'center',
          dataIndex: 'batchCode'
        },
     
          {
            title: '入库时间',
            align: 'center',
            dataIndex: 'rukuTime'
          },
		  {
		    title: '最后出库时间',
		    align: 'center',
		    dataIndex: 'chukuTime'
		  },
		  {
		    title: '规格',
		    align: 'center',
		    dataIndex: 'specificationsName'
		  },
		  {
		    title: '尺码',
		    align: 'center',
		    dataIndex: 'sizeCode'
		  },
		  {
		    title: '库存',
		    align: 'center',
		    dataIndex: 'newCount'
		  },
		  {
		    title: '库位',
		    align: 'center',
		    dataIndex: 'locationName'
		  },
		  {
		    title: '单价',
		    align: 'center',
		    dataIndex: 'intoUnit'
		  },
  

        // {
        // 			  title: '操作',
        // 			  dataIndex: 'action',
        // 			  align: "center",
        // 			  scopedSlots: {
        // 			    filterDropdown: 'filterDropdown',
        // 			    filterIcon: 'filterIcon',
        // 			    customRender: 'action'},
        			
        // },
              
        ],
    
   
        url: {
           detail:"/InveotoryQuery/kucundetail",
          list: "/Finance/getCompanyBusinessList?companyCode="+this.$route.query.companyCode,
           rollbackMoney:"/Finance/rollbackMoney"
        },
      }
    },
    created () {
		this.type=this.$route.query.type;
     // this.userId=this.$route.query.userId;
      this.getdetaildata();
	  this. bubu (1);
    },
    computed: {
      importExcelUrl: function () {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      },
    },
    methods: {
		
		see_orderDetail(orderSn,type){
			if(type==0){
				this.$router.push({path:'/orderCenter/fabricDetail',query: {order:orderSn}})
			}else if(type==1){
				this.$router.push({path:'/orderCenter/singleDetail',query: {order:orderSn}})
			}else if(type==2){
				this.$router.push({path:'/orderCenter/teamDetail',query: {order:orderSn}})
			}
		},
    getdetaildata(){
			getAction(this.url.detail,{"id":this.$route.query.id,type:this.$route.query.type}).then((res)=>{
			       if(res.success){  
			         this.fabricCode=res.result.fabricCode;
			         this.goodsCode=res.result.goodsCode;
			         this.unit=res.result.unit;
			         this.sumCount=res.result.sumCount;
			  	     this.supplierGoodsCode=res.result.supplierGoodsCode;	
				      this.gysfabriccode=res.result.gysfabriccode;
					this.menfu=res.result.menfu;
					this.fabricShazhi=res.result.fabricShazhi;
					this.pingpai=res.result.pingpai;
			       }else{
			         this.$message.warning(res.message);
			       } })
		},

        //打开设置月结的窗口
    setyuejiewindow: function () {
      this.$refs.modalForm.edit(this.$route.query.userId);
      this.$refs.modalForm.title = "设置月结";
      this.$refs.modalForm.disableSubmit = false;
    },
      initDictConfig () {

      },

      bubu (e) {
        this.tabs = e
        this.dataSource = []
        this.ipagination.total = 0
        this.ipagination.pageSize = 10
        if (this.tabs == 1) {
          this.neirong = '库存详情'
          this.loading = true
          let params = this.$route.query.id
          getAction('/InveotoryQuery/picilist', {
            id: params
          }).then((res) => {
            this.loading = false
            if (res.success) {
              this.dataSource = res.result.records
              this.ipagination.total = res.result.total
              this.ipagination.current = '1'
               this.url.list = '/InveotoryQuery/picilist?id=' + params
            }
          })
        } 
		
      }
    }
  }
</script>
<style scoped>
  .cd {
    display: none;
  }

  .cs {
    display: block;
  }

  @import '~@assets/less/common.less';
</style>
